package com.scs.application.modules.wm.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.scs.application.core.mapper.IBaseMapper;
import com.scs.application.modules.wm.entity.WorkOrder;
import com.scs.application.modules.wm.entity.WorkOrderItem;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 */
public interface WorkOrderMapper extends IBaseMapper<WorkOrder> {


    List<WorkOrder> dailyWorkOrder(@Param(value = "beginDate") String beginDate, @Param(value = "warehouseId") String warehouseId);

    /**
     * 更新订单科室
     * @param oprtUseKey
     */
    void updateOrderDept(@Param("oprtUseKey") String oprtUseKey);


    /**
     * 更新临采属性
     */
    void updateWorkOrder(@Param("workOrderId") String workOrderId);

    /**
     * 更新供应商
     */
    void updateOrderSupplier(@Param("workOrderId") String workOrderId,@Param("supplierId") String supplierId,@Param("supplierName") String supplierName);

    List<WorkOrder> workOrderBySN(@Param(value = "refKey") String refKey, @Param(value = "busType") String busType, @Param(value = "sn") String sn);

    /**
     * 执行查询获取耗材列表
     */
    List<WorkOrderItem> getListGroupByMatr(@Param(Constants.WRAPPER) QueryWrapper<WorkOrderItem> wrapper);

    List<WorkOrder> getOrderBySN(@Param(value = "snList") List<String> snList, @Param(value = "busType") String busType, @Param(value = "reagentTeamId") String reagentTeamId);

}
